package com.wdhcr.osspolicy.mode;

import lombok.Data;

import java.io.Serializable;


@Data
public class R implements Serializable {
    private int code;
    private String msg;
    private Object data;


    private R() {
    }

    private R(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    private R(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static R success(Object o) {
       return new R(200,"操作成功",o);
    }

    public static R success() {
        return new R(200,"操作成功");

    }

    public static R error() {
        return new R(500,"操作失败");
    }

    public static R error(String msg) {
        return new R(500,msg);
    }
}
